package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterDashDashViewPageUtil extends SeleniumPageUtil {
	public final static By CQD_TD_TITLE = By.xpath("//*[@id='Quoter_QuoteList1_pnlPage']/table/tbody/tr/td[4]");
	public final static By CQD_SPAN_TITLE = By.id("Quoter_QuoteList1_lblScope");
	public final static By CQD_FILTER_CONTRACT_ID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/div/img");
	public final static By CQD_FILTER_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/div/img");
	public final static By CQD_FILTER_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/div/img");
	public final static By CQD_FILTER_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/div/img");
	public final static By CQD_FILTER_CREATEBY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/div/img");
	public final static By CQD_FILTER_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/div/img");
	public final static By CQD_FILTER_SALESREP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/div/img");
	public final static By CQD_LINK_CONTRACT_ID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/a");
	public final static By CQD_LINK_REVISION = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/a");
	public final static By CQD_LINK_SUBVER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]/a");
	public final static By CQD_LINK_PDF = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/a");
	public final static By CQD_LINK_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/a");
	public final static By CQD_LINK_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/a");
	public final static By CQD_LINK_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/a");
	public final static By CQD_LINK_CREATEBY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/a");
	public final static By CQD_LINK_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/a");
	public final static By CQD_LINK_SALESREP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/a");
	public final static By CQD_LINK_ROUGH_MMC = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]/a");
	public final static By CQD_LINK_LINES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/a");
	public final static By CQD_LINK_DISCREPS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/a");
	public final static By CQD_LINK_ERRORS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]/a");
	public final static By CQD_LINK_WARNINGS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/a");
	public final static By CQD_LINK_CONFIG = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[16]/a");
	public final static By CQD_LINK_SIGN_OFF = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[17]/a");
	public final static By CQD_LINK_CAN_SIGN_OFF = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[18]/a");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH_OVERVIEW});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_DASH_OVERVIEW));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQD_TD_TITLE,CQD_LINK_CONTRACT_ID,CQD_LINK_CAN_SIGN_OFF
		});
	}
}
